from threading import Thread
import time


class MyThread(Thread):
    def __init__(self, name):
        super().__init__()
        self.name = name

    def run(self):
        time.sleep(2)
        print(f'{self.name}子线程运行了!')


if __name__ == '__main__':
    t = MyThread('1号')
    t.start()
    print('主线程')